<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Module: PDEHeadlessUtil
  
    &mdash; Documentation by YARD 0.7.4
  
</title>

  <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '';
  if (relpath != '') relpath += '/';
</script>

  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>


  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html">Index (P)</a> &raquo; 
    
    
    <span class="title">PDEHeadlessUtil</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a id="class_list_link" href="#">Class List</a>
  
    <a id="method_list_link" href="#">Method List</a>
  
    <a id="file_list_link" href="#">File List</a>
  
</div>
      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Module: PDEHeadlessUtil
  
  
  
</h1>

<dl class="box">
  
  
    
  
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">pde_headless_lib.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>
PDE Headless build工具核心类 定义了输入文件的模型，以及一些工具方法
</p>


  </div>
</div>
<div class="tags">
  
<h3>Author:</h3>
<ul class="author">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>
许祯
</p>
</div>
      
    </li>
  
</ul>

</div><h2>Defined Under Namespace</h2>
<p class="children">
   
    
   
    
      <strong class="classes">Classes:</strong> <span class='object_link'><a href="PDEHeadlessUtil/GlobalSetting.html" title="PDEHeadlessUtil::GlobalSetting (class)">GlobalSetting</a></span>, <span class='object_link'><a href="PDEHeadlessUtil/PDEHeadlessBuildInfo.html" title="PDEHeadlessUtil::PDEHeadlessBuildInfo (class)">PDEHeadlessBuildInfo</a></span>, <span class='object_link'><a href="PDEHeadlessUtil/PluginInfo.html" title="PDEHeadlessUtil::PluginInfo (class)">PluginInfo</a></span>, <span class='object_link'><a href="PDEHeadlessUtil/SVNInfo.html" title="PDEHeadlessUtil::SVNInfo (class)">SVNInfo</a></span>
    
  
</p>





  
    <h2>
      Class Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#correct_path-class_method" title="correct_path (class method)">+ (Object) <strong>correct_path</strong>(path) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
处理路径.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#execute_command-class_method" title="execute_command (class method)">+ (Object) <strong>execute_command</strong>(command) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
执行命令.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#execute_commands-class_method" title="execute_commands (class method)">+ (Object) <strong>execute_commands</strong>(commands) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
执行命令.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#get_now-class_method" title="get_now (class method)">+ (String) <strong>get_now</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
获取当前时间.
</p>
</div></span>
  
</li>

      
    </ul>
  



  <div id="class_method_details" class="method_details_list">
    <h2>Class Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="correct_path-class_method">
  
    + (<tt>Object</tt>) <strong>correct_path</strong>(path) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
处理路径
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


141
142
143</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_lib.rb', line 141</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_correct_path'>correct_path</span><span class='lparen'>(</span> <span class='id identifier rubyid_path'>path</span> <span class='rparen'>)</span>
	<span class='kw'>return</span> <span class='id identifier rubyid_path'>path</span> <span class='op'>+</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_path'>path</span><span class='lbracket'>[</span><span class='id identifier rubyid_path'>path</span><span class='period'>.</span><span class='id identifier rubyid_length'>length</span><span class='op'>-</span><span class='int'>1</span><span class='rbracket'>]</span> <span class='op'>!=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>/</span><span class='tstring_end'>&quot;</span></span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="execute_command-class_method">
  
    + (<tt>Object</tt>) <strong>execute_command</strong>(command) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
执行命令
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='name'>commands</span>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>
命令列表
</p>
</div>
      
    </li>
  
</ul>

<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
      
        <span class='type'></span>
      
      
      
        
        <div class='inline'><p>
执行命令出错将raise
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


156
157
158
159
160</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_lib.rb', line 156</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span> <span class='id identifier rubyid_command'>command</span> <span class='rparen'>)</span>
	<span class='comment'>## 过滤用户名密码
</span>	<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_command'>command</span><span class='lbracket'>[</span><span class='int'>0</span><span class='op'>...</span><span class='id identifier rubyid_command'>command</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>--username</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='rbracket'>]</span>
	<span class='id identifier rubyid_raise'>raise</span> <span class='kw'>if</span> <span class='kw'>false</span> <span class='op'>==</span> <span class='id identifier rubyid_system'>system</span><span class='lparen'>(</span> <span class='id identifier rubyid_command'>command</span> <span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="execute_commands-class_method">
  
    + (<tt>Object</tt>) <strong>execute_commands</strong>(commands) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
执行命令
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='name'>commands</span>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>
命令列表
</p>
</div>
      
    </li>
  
</ul>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


147
148
149
150
151</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_lib.rb', line 147</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute_commands'>execute_commands</span><span class='lparen'>(</span> <span class='id identifier rubyid_commands'>commands</span> <span class='rparen'>)</span>
	<span class='id identifier rubyid_commands'>commands</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_command'>command</span><span class='op'>|</span>	
		<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span> <span class='id identifier rubyid_command'>command</span> <span class='rparen'>)</span>	
	<span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="get_now-class_method">
  
    + (<tt>String</tt>) <strong>get_now</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
获取当前时间
</p>


  </div>
</div>
<div class="tags">
  
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>
当前时间戳, 格式为: 201201300101
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


136
137
138</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_lib.rb', line 136</span>

<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_get_now'>get_now</span>
	<span class='kw'>return</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='period'>.</span><span class='id identifier rubyid_strftime'>strftime</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>%Y%m%d%H%M</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Mon Jan 30 13:37:15 2012 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.7.4 (ruby-1.9.2).
</div>

  </body>
</html>